Skip to content

debuginfo: Add a name for tuple fields in debuginfo so that they can be accessed in debuggers. #24351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2015

Conversation

michaelwoerister
Copy link
Member

This PR makes rustc emit field names for tuple fields in DWARF. Formerly there was no way of directly accessing the fields of a tuple in GDB and LLDB since there is no C/C++ equivalent to this. Now, the debugger sees the name __{field-index} for tuple fields. So you can type for example some_tuple_val.__2 to get the third tuple component.
When pretty printers are used (e.g. via rust-gdb or rust-lldb) these artificial field names will not clutter tuple rendering (which was the main motivation for not doing this in the past).

Solves #21948.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@jdm
Copy link
Contributor

jdm commented Apr 12, 2015

💯

@michaelwoerister
Copy link
Member Author

It's always the same with you, @michaelwoerister...
Fixed the line-length issue.

@alexcrichton
Copy link
Member

@bors: r+ 03f9269

Nice!

@ghost
Copy link

ghost commented Apr 13, 2015

Cool! Just to confirm, this couldn't be just {field-index} (as that's what the Rust equivalent is) because of restrictions on the field names, right?

@michaelwoerister
Copy link
Member Author

@jakub- That's correct. I've tried using just the index but GDB's parser can't handle that.

@bors
Copy link
Collaborator

bors commented Apr 13, 2015

⌛ Testing commit 03f9269 with merge b9ed9e2...

bors added a commit that referenced this pull request Apr 13, 2015
…chton

This PR makes `rustc` emit field names for tuple fields in DWARF. Formerly there was no way of directly accessing the fields of a tuple in GDB and LLDB since there is no C/C++ equivalent to this. Now, the debugger sees the name `__{field-index}` for tuple fields. So you can type for example `some_tuple_val.__2` to get the third tuple component.
When pretty printers are used (e.g. via `rust-gdb` or `rust-lldb`) these artificial field names will not clutter tuple rendering (which was the main motivation for not doing this in the past).

Solves #21948.
@bors bors merged commit 03f9269 into rust-lang:master Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants